@extends('layouts.master')
@section('content')
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-content">
                    <form class="layui-form" action="">
                        <div class="layui-inline">
                            <label class="layui-form-label">订单号:</label>
                            <div class="layui-input-inline">
                                <input type="text" name="query[order_id]" lay-verify="" placeholder="订单号搜索"
                                       value="{{$query['order_id']}}" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline" style="padding-bottom: 5px">
                            <div class="layui-input-inline">
                                <input type="hidden" name="page_num" value="{{$currentPageNum}}">
                                <button name="submit" class="btn btn-success" type="submit">搜索</button>
                            </div>
                        </div>
                    </form>
                    @include('common.toolbar', ['pager' => $pager])
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>订单号</th>
                            <th>单价</th>
                            <th>数量</th>
                            <th>收货人</th>
                            <th>实际支付</th>
                            <th>下单时间</th>
                            <th>备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($pager as $item)
                            <tr class="tr_checkbox_switch">
                                <td>
                                    {{$item->order_id}}
                                </td>
                                <td>
                                    {{$item->order_extend['price']}}
                                </td>
                                <td>
                                    {{$item->order_extend['num']}}
                                </td>
                                <td>
                                    <div style="display: flex;flex-direction: column">
                                        <div>地址：{{$item->to_address}}</div>
                                        <div>姓名：{{$item->to_name}}</div>
                                        <div>手机号：{{$item->to_phone}}</div>
                                    </div>
                                </td>
                                <td>
                                    ￥{{$item->pay_price}}
                                </td>
                                <td>
                                    {{$item->add_time}}
                                </td>
                                <td>
                                    {{$item->mark}}
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @include('common.pagination', ['pager' => $pager])
                </div>
            </div>
        </div>
    </div>
@endsection
@section('script')
    <script>
        layui.use(['laydate', 'element'], function () {
            var laydate = layui.laydate, element = layui.element;
            //日期时间选择器
            laydate.render({
                elem: '.start_time'
                , type: 'datetime'
            });
            laydate.render({
                elem: '.end_time'
                , type: 'datetime'
            });
        });
    </script>
@endsection
